//
//  SGCorePayment+AliPay.h
//  smartGas
//
//  Created by chen on 2017/11/20.
//  Copyright © 2017年 chen. All rights reserved.
//

#import "SGCorePayment.h"

@interface SGCorePayment (AliPay)

#pragma mark - 支付宝支付

/**支付宝支付测试使用*/
+ (void)aliPayDebug  DEPRECATED_MSG_ATTRIBUTE("测试使用。不会支付成功,请使用`alipayWithOrderInfoEncoded:signedString:`方法");


/**
 生成订单数据字符串,随后需要将`orderInfo`传给后台加密
 
 @param contentBody 商品描述
 @param subject 订单标题
 @param out_trade_no 订单ID
 @param total_amount 商品价格
 @param block 返回编码后的字符串
 */
+ (void)alipay_encodeGoodsStringWithContentBody:(NSString *)contentBody//商品描述
                                        subject:(NSString *)subject //订单标题
                                   out_trade_no:(NSString *)out_trade_no //订单ID
                                   total_amount:(CGFloat)total_amount //商品价格
                                       callBack:(void(^)(NSString *orderInfo,NSString *orderInfoEncoded))block;

/**
 下订单
 
 @param orderInfoEncoded 编码后的订单信息
 @param signedString 后台对订单签名的数据
 */
+ (void)alipayWithOrderInfoEncoded:(NSString *)orderInfoEncoded
                      signedString:(NSString *)signedString;



/**
 下订单

 @param orderString 拼接好的orderString
 */
+ (void)alipayWithOrderWithOrderString:(NSString *)orderString;



/**
 生成支付宝订单
 */
+ (void)aliPayGeneratePaymentWithUserId:(NSString *)userId
                                 amount:(NSString *)amount
                                   type:(SGCorePaymentType)paymentType
                              goodsType:(SGCorePaymentGoodsType)goosType
                             relationId:(NSString *)relationId
                                success:(void(^)(NSString *token,NSString *des))success
                                 failed:(void(^)(NSError *error, NSString *des))failed;




@end







